<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page isELIgnored="false"%>
<html>
<head>
    <title>运单管理</title>
</head>
<body>
<input type="hidden" id="logistics" value="${logistics}"/>
<div ng-app="myApp" ng-controller="LogisticsCtrl">
    <ui-form key="logisticsUpdate" column="2">
        <input name="id" type="hidden" value="${logistics.id}"/>
        <ui-form-input name="waybillNum" label="运单号:" value="${logistics.waybillNum}" readOnly="true"></ui-form-input>
        <ui-form-input name="businessCode" label="订单号:"  value="${logistics.businessCode}" readOnly="true"></ui-form-input>
        <ui-form-date name="acceptScheduled" label="应揽收时间:" value="${logistics.acceptScheduledStr}"></ui-form-date>
        <ui-form-select name="accept" label="是否入库:"  value="${logistics.accept}">
            <option value="0">否</option>
            <option value="1">是</option>
        </ui-form-select>
        <ui-form-date name="acceptTime" label="入库时间:" value="${logistics.acceptTimeStr}"></ui-form-date>
        <ui-form-select name="warehouseOut" label="是否出库:" value="${logistics.warehouseOut}">
            <option value="0">否</option>
            <option value="1">是</option>
        </ui-form-select>
        <ui-form-date name="warehouseOutTime" label="出库时间:" value="${logistics.warehouseOutTimeStr}"></ui-form-date>
        <ui-form-select name="siteIn" label="是否到站:" value="${logistics.siteIn}">
            <option value="0">否</option>
            <option value="1">是</option>
        </ui-form-select>
        <ui-form-date name="siteInTime" label="到站时间:" value="${logistics.siteInTimeStr}"></ui-form-date>
        <ui-form-select name="siteOut" label="是否出站:" value="${logistics.siteOut}">
            <option value="0">否</option>
            <option value="1">是</option>
        </ui-form-select>
        <ui-form-date name="siteOutTime" label="出站时间:" value="${logistics.siteOutTimeStr}"></ui-form-date>
        <ui-form-date name="signTimePromised" label="承诺送达时间:" value="${logistics.signTimePromisedStr}"></ui-form-date>
        <ui-form-select-remote
                url="regioncode/list"
                label="省:"
                name="province_consignee"
                value-name="code"
                text-name="name"
                value="${logistics.provinceConsignee.code}">
        </ui-form-select-remote>
        <ui-form-select-remote
                url="regioncode/list"
                label="市:"
                name="city_consignee"
                value-name="code"
                text-name="name"
                value="${logistics.cityConsignee.code}">
        </ui-form-select-remote>
        <ui-form-select-remote
            url="regioncode/list"
            label="区:"
            name="county_consignee"
            value-name="code"
            text-name="name"
            value="${logistics.countyConsignee.code}">
        </ui-form-select-remote>
        <ui-form-select name="direction" label="配送类型:" value="${logistics.direction}">
            <option value="0">配送</option>
            <option value="1">上门退</option>
            <option value="2">上门换</option>
        </ui-form-select>
        <ui-form-select name="temperature" label="运输温度等级:" value="${logistics.temperature}">
            <option value="0">常温</option>
            <option value="1">生鲜冷链</option>
        </ui-form-select>
        <ui-form-select name="expressScheduleType" label="运输时效要求:" value="${logistics.expressScheduleType}">
            <option value="0">未知</option>
            <option value="1">当日达</option>
            <option value="2">次晨达</option>
            <option value="3">三日达</option>
            <option value="4">工作日</option>
            <option value="5">节假日</option>
            <option value="6">夜间配</option>
            <option value="7">上午达</option>
            <option value="8">下午达</option>
        </ui-form-select>
        <ui-form-select name="packageSize" label="包裹大小规格:" value="${logistics.packageSize}">
            <option value="0">未知</option>
            <option value="1">小件</option>
            <option value="1">大件</option>
        </ui-form-select>
        <ui-form-select name="expensive" label="贵品:" value="${logistics.expensive}">
            <option value="0">否</option>
            <option value="1">是</option>
        </ui-form-select>
        <ui-form-input name="weight" label="重量:" value="${logistics.weight}"></ui-form-input>
        <ui-form-input name="volume" label="包裹体积:"  value="${logistics.volume}"></ui-form-input>
        <ui-form-input name="length" label="包裹长度:" value="${logistics.length}"></ui-form-input>
        <ui-form-input name="width" label="包裹宽度:"  value="${logistics.width}"></ui-form-input>
        <ui-form-select name="importSource" label="运单来源:" value="${logistics.importSource}">
            <option value="0">系统接入</option>
            <option value="1">手工导入</option>
        </ui-form-select>
        <ui-form-select-remote
                url="system/supplier/listall"
                label="供货商:"
                name="supplierCode"
                value-name="code"
                text-name="name"
                value="${logistics.supplier.code}">
        </ui-form-select-remote>
        <ui-form-input name="supplierWarehouse" label="商家发货仓:" value="${logistics.supplierWarehouse}"></ui-form-input>
        <ui-form-input name="nameConsignee" label="收件人姓名:"  value="${logistics.nameConsignee}"></ui-form-input>
        <ui-form-input name="cod" label="代收货款:" value="${logistics.cod}"></ui-form-input>
        <ui-form-input name="codBack" label="代退货款:"  value="${logistics.codBack}"></ui-form-input>
        <ui-form-input name="orderAmount" label="订单价格:" value="${logistics.orderAmount}"></ui-form-input>
        <ui-form-input name="sendNum" label="发货数量:"  value="${logistics.sendNum}"></ui-form-input>
        <ui-form-input name="postmanNo" label="配送员工号:" value="${logistics.postmanNo}"></ui-form-input>
        <ui-form-input name="orgcodeAccept" label="导入机构:"  value="${logistics.orgAccept.name}"></ui-form-input>
        <ui-form-input name="orgcodeCurrent" label="当前机构:" value="${logistics.orgCurrent.name}"></ui-form-input>
        <ui-form-input name="orgcodeDelivery" label="实际配送站点:"  value="${logistics.orgDelivery.name}"></ui-form-input>
        <ui-form-input name="orgcodeTarget" label="匹配站点:" value="${logistics.orgTarget.name}"></ui-form-input>
        <ui-form-select name="status" label="配送状态:" value="${logistics.status}">
            <option value="0">配送中</option>
            <option value="1">配送成功</option>
            <option value="2">配送失败</option>
        </ui-form-select>
        <%--<ui-form-select name="nodeCurrent" label="运单流转节点:" value="${logistics.nodeCurrent}">--%>
            <%--<option value="000">系统导入</option>--%>
            <%--<option value="001">人工导入</option>--%>
            <%--<option value="101">仓库入库</option>--%>
            <%--<option value="102">仓库出库</option>--%>
            <%--<option value="103">中转入库</option>--%>
            <%--<option value="104">中转出库</option>--%>
            <%--<option value="105">退货入库</option>--%>
            <%--<option value="106">退货出库</option>--%>
            <%--<option value="105">返单入库</option>--%>
            <%--<option value="106">返单出库</option>--%>
            <%--<option value="107">退商家出库</option>--%>
            <%--<option value="108">退商拒收返库</option>--%>
            <%--<option value="109">退商家成功</option>--%>
            <%--<option value="110">反库入库</option>--%>
            <%--<option value="200">站点入站</option>--%>
            <%--<option value="201">中转入站</option>--%>
            <%--<option value="202">滞留入站</option>--%>
            <%--<option value="203">配送出站</option>--%>
            <%--<option value="204">中转出站</option>--%>
            <%--<option value="205">退货出站</option>--%>
            <%--<option value="206">退货入站</option>--%>
            <%--<option value="207">退商家出站</option>--%>
            <%--<option value="208">返单出站</option>--%>
            <%--<option value="209">返单入站</option>--%>
            <%--<option value="210">订单签收</option>--%>
            <%--<option value="211">订单拒收</option>--%>
            <%--<option value="300">订单丢失</option>--%>
        <%--</ui-form-select>--%>
        <ui-form-date name="signTime" label="运单签收时间:" value="${logistics.signTimeStr}" readOnly="true"></ui-form-date>
        <ui-form-input name="guaranteeFee" label="保费:"  value="${logistics.guaranteeFee}"></ui-form-input>
        <ui-form-select name="signer" label="本人签收:" value="${logistics.signer}">
        <option value="0">否</option>
        <option value="1">是</option>
        </ui-form-select>
        <ui-form-input name="businessRemark" label="供应商备注:"  value="${logistics.businessRemark}"></ui-form-input>
        <ui-form-input name="remark" label="运单备注:" value="${logistics.remark}"></ui-form-input>
    </ui-form>
</div>
<script>
    angular.module('myApp', ['ui.form']);
    angular.module('myApp').controller('LogisticsCtrl', function ($scope) {
        $scope.$on('ui.form.submit',function (event,param) {
            $.ajax({
                url:"system/logistics/update",
                type:"post",
                data:param
            }).done(function (result) {
                if(result.code=='0000'){
                    toastr.success(result.data);
                }else{
                    toastr.error(result.msg);
                }
            }).fail(function (err) {

            });
        })
    });
</script>
</body>
</html>